<template>
  <basic-dialog
    :width="'60%'"
    :visible="visible"
    :title="'处理日志'"
    :show-footer="false"
    :handle-close="onCancel"
  >
    <div>
      <basic-list
        :data-source="dealLogList"
        :columns="columns"
        :show-select-col="false"
        :show-pagination="false"
      />
    </div>
  </basic-dialog>
</template>
<script>
import BasicDialog from '@/components/BasicDialog';
import BasicList from '@/components/BasicTable';

export default {
  name: 'DealLogDialog',
  components: {
    BasicDialog,
    BasicList,
  },
  props: {
    dialogVisible: {
      type: Boolean,
    },
    dialogData: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data () {
    return {
      columns: [
        {
          key: 'processingTypeStr',
          title: '处理方式',
        },
        {
          key: 'remark',
          title: '处理备注',
        },
        {
          key: 'processingUserName',
          title: '处理人',
        },
        {
          key: 'processingUserDeptName',
          title: '部门',
        },
        {
          key: 'processingTime',
          title: '处理时间',
        },
        {
          key: 'planSolveDate',
          title: '预计解决日期',
        },
      ],
    };
  },
  computed: {
    visible () {
      return this.dialogVisible;
    },
    dealLogList () {
      return this.dialogData;
    },
  },
  methods: {
    onCancel () {
      this.$emit('hide-handler');
    },
    handleDownLoad (row) {
      if (!row.downloadUrl) {
        return this.$message.error('文件异常');
      }
      window.location.href = row.downloadUrl
    }
  },
};
</script>
